﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using Lamex.Library;
using Lamex.Interface;
using Lamex.Library.CommonClass;

namespace Lamex.mMachine.UI
{
    public partial class frmMAC_Main : frmModuleBase
    {
        public frmMAC_Main()
        {
            InitializeComponent();
            menuStrip1.Text = ModuleNames.mMachine; //与AssemblyModuleEntry.ModuleName定义相同
        }

        public override MenuStrip GetModuleMenu()
        {
            return this.menuStrip1;
        }

        #region 台帐管理

        private void menuMAC_Account_Overview_Report_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmMAC_Equipment_Overview), sender as ToolStripMenuItem);
        }

        private void menuMAC_Account_Overview_Detail_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("View_FAMA_Equipment_Account_Sumarize", 0, false, false), sender as ToolStripMenuItem);
        }

        private void menuMAC_Account_Purchase_Plan_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("FAMA_Account_Purchase_plan", 0, true, false), sender as ToolStripMenuItem);
        }

        private void menuMAC_Account_Basic_Info_Click(object sender, EventArgs e)
        {
            //MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("FAMA_Account_Basic_Info", 0, true, false), sender as ToolStripMenuItem);
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmMAC_Equipment_Basic_Info), sender as ToolStripMenuItem);
        }

        private void menuMAC_Account_Assets_Info_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("FAMA_Account_Assets_Info", 0, true, false), sender as ToolStripMenuItem);
            //MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmMAC_Equipment_Assets_Info), sender as ToolStripMenuItem);
        }
        private void menuMAC_Account_Location_Info_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("FAMA_Account_Location_Info", 0, true, false), sender as ToolStripMenuItem);
            //MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmMAC_Equipment_Location_Info), sender as ToolStripMenuItem);
        }

        private void menuMAC_Account_Current_State_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("FAMA_Account_Current_State", 0, true, false), sender as ToolStripMenuItem);
        }
        private void menuMAC_File_Path_Info_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmMAC_File_Path_Info), sender as ToolStripMenuItem);
        }
        #endregion

        #region 故障维修

        private void menuMAC_Machine_Failure_Submit_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmMAC_MT_Failure_Process), sender as ToolStripMenuItem);
        }

        private void menuMAC_Machine_Failure_Record_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmMAC_MT_Content_Input), sender as ToolStripMenuItem);
        }

        private void menuMAC_Outsource_Maintenance_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmMAC_MT_Outsource), sender as ToolStripMenuItem);
        }

        private void menuMAC_Machine_Failure_Report_Click(object sender, EventArgs e)
        {

        }

        #endregion

        #region 设备保养

        private void menuMAC_Machine_Upkeep_Record_Click(object sender, EventArgs e)
        {
            //MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("", 0, false, false), sender as ToolStripMenuItem);
        }

        private void menuMAC_Machine_Upkeep_Plan_Click(object sender, EventArgs e)
        {

        }

        private void menuMAC_Machine_Upkeep_Report_Click(object sender, EventArgs e)
        {

        }

        #endregion

        #region 维修资源

        private void menuMAC_Resource_Staff_List_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("MT_Resource_Worker_List", 0, true, false), sender as ToolStripMenuItem);
        }

        private void menuMAC_Resource_Response_Level_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("MT_Mail_Notice_Level", 0, true, false), sender as ToolStripMenuItem);
        }

        private void menuMAC_Resource_non_Workday_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Resource_nonWorkday_List", 0, true, false), sender as ToolStripMenuItem);
        }

        private void menuMAC_Resource_Working_Duration_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Resource_Workday_Duration", 0, true, false), sender as ToolStripMenuItem);
        }

        private void menuMAC_Resource_Staff_Allocation_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("Resource_Staff_Allocation", 0, true, false), sender as ToolStripMenuItem);
        }

        private void menuMAC_Resource_Dept_List_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("MT_Resource_Dept_List", 0, true, false), sender as ToolStripMenuItem);
        }

        #endregion

        #region 备件

        private void menuMAC_Spare_Parts_Library_Click(object sender, EventArgs e)
        {
            //嵌入窗体winform
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmExeForm(@"\\tx-fs10\tx-fs1\IMA\Tools - MES\Lucas\Lamex SparePart Management System\bin\Debug\Lamex SparePart Management System.exe", "备件管理"), sender as ToolStripMenuItem);
        }

        private void menuMAC_Spare_Parts_Access_Click(object sender, EventArgs e)
        {
            //因修改时间及用户字段设计不一致，不开放更新数据功能
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("SPAREPART_ACCESS", 0, false, true), sender as ToolStripMenuItem);
        }

        #endregion

        #region 水电消耗

        private void menuFAMA_Water_Power_Record_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("FAMA_WatPow_Meter_Reading", 0, true, false), sender as ToolStripMenuItem);
        }

        private void menuFAMA_Water_Power_Destribute_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("FAMA_WatPow_Meter_Distribute", 0, true, true), sender as ToolStripMenuItem);
        }

        private void menuFAMA_Water_Power_Analysis_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildForm(this.MdiParent as IMdiForm, typeof(frmFAMA_WarPow_Data_Analysis), sender as ToolStripMenuItem);
        }

        #endregion

        #region 其他

        private void menuMAC_FaultRecord_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("View_Issue_Record_EQ", 0, false, false), sender as ToolStripMenuItem);
        }

        private void menuMAC_ToolList_Click(object sender, EventArgs e)
        {

        }





        #endregion

        #region 盘点

        private void menuMAC_Inventory_Record_Click(object sender, EventArgs e)
        {
            MdiTools.OpenChildWebBrowse(this.MdiParent as IMdiForm, new frmBaseChildWinForm("FAMA_Account_Stocktake_Record", 0, true, false), sender as ToolStripMenuItem);
        }

        #endregion

    }
}